package com.hsgene.consumables.service.api.impl;

import com.hsgene.common.util.exception.CommonErrorCode;
import com.hsgene.common.util.result.ApiResult;
import com.hsgene.consumables.service.api.GeneratorService;
import com.hsgene.generator.dto.GeneratorDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @author wangbing
 * @version 1.0, 2018/11/13
 */
@Component
public class GeneratorServiceImpl implements GeneratorService {

    private final static Logger LOGGER = LoggerFactory.getLogger(GeneratorServiceImpl.class);

    @Override
    public ApiResult<GeneratorDto> generate(String type, String prefix) {
        LOGGER.error("调用ID生成器服务失败");
        return ApiResult.fail(CommonErrorCode.GENERATOR_SERVICE_NOT_AVAILABLE);
    }

    @Override
    public ApiResult<GeneratorDto> numberGenerator(String prefixType, Integer workerId, Integer datacenterId) {
        LOGGER.error("调用ID生成器服务失败");
        return ApiResult.fail(CommonErrorCode.GENERATOR_SERVICE_NOT_AVAILABLE);
    }
}
